import axios from 'axios';
import config from '../../../config';
class ArticleApi {
  async getArticle () {
    try {
      const url = `//${config.host}:${config.port}${config.api.article.list}`;
      console.log(url);
      const reponse = await axios.get(
        url,
      );
      if (reponse.status === 200) {
        return reponse.data;
      }
    } catch (e) {
      console.error(e);
      return e;
    }
  }
}

export default new ArticleApi();
